IRC Tramp CLI Power Tables#11217
IRC Tramp CLI Power Tables#11217SomeTestStuffDoesntWork wants to merge 2 commits intoiNavFlight:maintenance-9.xfrom
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
|
Thanks for doing your first INAV PR! A lot of people will be very happy about this, because they've been asking for it for a long time. This is great, if it works out. You mentioned comments. Let me comment on comments. :) That's great code - totally self-explanatory. Someone who isn't even a programmer could likely read and pretty much understand that because it reads pretty much like English prose. If cmdLine is empty, print an error and return. Awesome. THEREFORE, the comment repeating what the code says may be unnecessary noise that actually ends up making the code harder to read by making it longer: There's also the question there of -- are the comments before the code or after? Hmm, both? But here there is nothing to explain - it's great, self-evident code. Typically, comments should describe WHY the code is doing something that isn't obvious. This certainly might! A comment could say 0.0 is added to make it a float. ( Though maybe explicitly casting to a float would be better in that example.) We have a function called constructPowerTable(). Which contructs the power table, of course. |
…ed better range checks to PL commands. Hooked the new configuration into settings.yaml. Added preprocessor conditionals to static functions for tramp PL configuration to ensure that when the tramp option excludes the commands from the build the static processing functions are not left unused. Added tramp_pl_table command to ease updating the configuration in the cases where no default hard coded PL table values are to be reused. If less than the max number of PL entries are provided, remaining entries are filled with that of the last passed PL to ensure that the default values are not used. Tested on F405, worked without issue.
This all sounds good to me. Took a pass through and cleaned up the comments. Additionally, this commit should fix the unused static function errros from SITL builds. Had the commands in preprocessor conditionals but not the static functions used to service those commands. The functions should now follow the command definitions |
|
Hi @SomeTestStuffDoesntWork this is a great addition and something I've been looking for in INAV since I have some IRC Tramp based VTXs that won't work properly in the current implementation. I'm in the process of testing your code applied to INAV 9.0.1 and came across some problems as I wasn't fully able to replicate the success you had in your PR. I was able to fix the first problem (though not sure if it is correct), which is that default and min values for the new cli variable I've confirmed with these two changes that the firmware builds correctly and does not throw any system errors in INAV Configurator. For reference, the FC that I'm testing this on is the AtomRC F405 Navi and the Jhemcu Ruibet Tran 3016 VTX. After doing a full erase flash with the modified firmware, I applied the VTX power table using I hardcoded the table the old way as described in this discussion #8340 and was able to confirm all 5 power values work as expected once I force INAV to use the hardcoded table for the 1600mw VTX using the Would you happen to know why this could be? Additionally, I don't fully understand the purpose of the variable I think your implementation could also be refined if there is no default table at all. To simplify the code and usability, would it make sense to have the user manually define the power values for their specific IRC Tramp vtx that way there's little to no confusions about what's overriding what? Thanks for your help with helping me understand your code better! |
Summary
Testing
This has been tested with an ATOMRC F405 NAVI on the ground communicating with a stubborn VTX. This VTX was particulary impacted by the default tables as its PLs are set as 1, 2, and 3 in place of milliwatt values, making the defaults impossible to use. Changing PL entries 1, 2, and 3 to 1, 2, and 3 milliwatts respectively fixed this issue and the VTX correctly transitioned to higher PLs on command. Non-volatile storage was tested and saved values were recovered across power cycles. Configuration reset was also tested and all values initialized to -1 as expected. Additional board tests may be required.
Please Note: This contains a settings change and will most likely require a diff all + full erase + reapplication of original config in order to perform further testing.
Related
This may fix the following:
Other Notes
I apologize in advance for any coding standards inconsistencies. I regularly use a slightly different set and some issues may have slipped through. Additionally, I have left a fair quantity of comments. Some of these may not be as useful, but I tend to err on the side of more comments rather than less to assist with later maintenance. I can remove the majority of these if they just add noise.